import bus from '@/bus'
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  columns: [{
    title: '服务分类',
    align: 'left',
    key: 'categoryName'
  }, {
    title: '服务商品名称',
    key: 'name',
    align: 'left'
  }, {
    title: '服务单价(元)',
    key: 'price',
    align: 'left'
  }, {
    title: '是否启用',
    align: 'left',
    render: (h, params) => {
      return h('div', [
        h('i-switch', {
          props: {
            type: 'primary',
            value: params.row.isEnabled
          },
          on: {
            'on-change': (value) => {
              bus.$emit('onSwitch', params.row.id, value, params.index)
            }
          }
        })
      ])
    }
  }, {
    title: '操作',
    align: 'left',
    render: (h, params) => {
      let editBtn = h('Button', {
        props: {
          size: 'small',
          type: 'primary'
        },
        class: 'mr',
        on: {
          click: () => {
            bus.$emit('onEdit', { id: params.row.id, categoryId: params.row.categoryId })
          }
        }
      }, '编辑')
      let delBtn = h('Button', {
        props: {
          size: 'small'
        },
        on: {
          click: () => {
            bus.$emit('onDelete', { id: params.row.id, index: params.index })
          }
        }
      }, '删除')
      return h('div', [editBtn, delBtn])
    }
  }],
  data: []
}
export default data